using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class DIC_SALARY_FORMULAData : DatabaseObjectBase
	{
		public DIC_SALARY_FORMULAData()
		{
			Initialize(true);
		}
		public DIC_SALARY_FORMULAData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 DIC_SALARY_FORMULA_Insert(Guid FormulaID, Double SocialInsurance1, Double HealthInsurance1, Double UnemploymentInsurance1, Double SocialInsurance2, Double HealthInsurance2, Double UnemploymentInsurance2, Decimal MaximumInsurance, Double CoefficientUnion, Decimal MaximumUnion, Decimal IncomeTax, Decimal PersonIncomeTax, Double Workday, Double Sunday, Double Holiday)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("DIC_SALARY_FORMULA_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SocialInsurance1", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@HealthInsurance1", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance1", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SocialInsurance2", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@HealthInsurance2", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance2", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@CoefficientUnion", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MaximumUnion", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@IncomeTax", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonIncomeTax", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Workday", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Sunday", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Holiday", SqlDbType.Float));
				_dbadapter.InsertCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.InsertCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				SqlDouble SocialInsurance1SQL = SocialInsurance1;
				_dbadapter.InsertCommand.Parameters["@SocialInsurance1"].Value = SocialInsurance1SQL;
				SqlDouble HealthInsurance1SQL = HealthInsurance1;
				_dbadapter.InsertCommand.Parameters["@HealthInsurance1"].Value = HealthInsurance1SQL;
				SqlDouble UnemploymentInsurance1SQL = UnemploymentInsurance1;
				_dbadapter.InsertCommand.Parameters["@UnemploymentInsurance1"].Value = UnemploymentInsurance1SQL;
				SqlDouble SocialInsurance2SQL = SocialInsurance2;
				_dbadapter.InsertCommand.Parameters["@SocialInsurance2"].Value = SocialInsurance2SQL;
				SqlDouble HealthInsurance2SQL = HealthInsurance2;
				_dbadapter.InsertCommand.Parameters["@HealthInsurance2"].Value = HealthInsurance2SQL;
				SqlDouble UnemploymentInsurance2SQL = UnemploymentInsurance2;
				_dbadapter.InsertCommand.Parameters["@UnemploymentInsurance2"].Value = UnemploymentInsurance2SQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.InsertCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlDouble CoefficientUnionSQL = CoefficientUnion;
				_dbadapter.InsertCommand.Parameters["@CoefficientUnion"].Value = CoefficientUnionSQL;
				SqlMoney MaximumUnionSQL = MaximumUnion;
				_dbadapter.InsertCommand.Parameters["@MaximumUnion"].Value = MaximumUnionSQL;
				SqlMoney IncomeTaxSQL = IncomeTax;
				_dbadapter.InsertCommand.Parameters["@IncomeTax"].Value = IncomeTaxSQL;
				SqlMoney PersonIncomeTaxSQL = PersonIncomeTax;
				_dbadapter.InsertCommand.Parameters["@PersonIncomeTax"].Value = PersonIncomeTaxSQL;
				SqlDouble WorkdaySQL = Workday;
				_dbadapter.InsertCommand.Parameters["@Workday"].Value = WorkdaySQL;
				SqlDouble SundaySQL = Sunday;
				_dbadapter.InsertCommand.Parameters["@Sunday"].Value = SundaySQL;
				SqlDouble HolidaySQL = Holiday;
				_dbadapter.InsertCommand.Parameters["@Holiday"].Value = HolidaySQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SALARY_FORMULA_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SALARY_FORMULA_Update(Guid FormulaID, Double SocialInsurance1, Double HealthInsurance1, Double UnemploymentInsurance1, Double SocialInsurance2, Double HealthInsurance2, Double UnemploymentInsurance2, Decimal MaximumInsurance, Double CoefficientUnion, Decimal MaximumUnion, Decimal IncomeTax, Decimal PersonIncomeTax, Double Workday, Double Sunday, Double Holiday)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SALARY_FORMULA_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@CoefficientUnion", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumUnion", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IncomeTax", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonIncomeTax", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Workday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Sunday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Holiday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.UpdateCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				SqlDouble SocialInsurance1SQL = SocialInsurance1;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance1"].Value = SocialInsurance1SQL;
				SqlDouble HealthInsurance1SQL = HealthInsurance1;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance1"].Value = HealthInsurance1SQL;
				SqlDouble UnemploymentInsurance1SQL = UnemploymentInsurance1;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance1"].Value = UnemploymentInsurance1SQL;
				SqlDouble SocialInsurance2SQL = SocialInsurance2;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance2"].Value = SocialInsurance2SQL;
				SqlDouble HealthInsurance2SQL = HealthInsurance2;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance2"].Value = HealthInsurance2SQL;
				SqlDouble UnemploymentInsurance2SQL = UnemploymentInsurance2;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance2"].Value = UnemploymentInsurance2SQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.UpdateCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlDouble CoefficientUnionSQL = CoefficientUnion;
				_dbadapter.UpdateCommand.Parameters["@CoefficientUnion"].Value = CoefficientUnionSQL;
				SqlMoney MaximumUnionSQL = MaximumUnion;
				_dbadapter.UpdateCommand.Parameters["@MaximumUnion"].Value = MaximumUnionSQL;
				SqlMoney IncomeTaxSQL = IncomeTax;
				_dbadapter.UpdateCommand.Parameters["@IncomeTax"].Value = IncomeTaxSQL;
				SqlMoney PersonIncomeTaxSQL = PersonIncomeTax;
				_dbadapter.UpdateCommand.Parameters["@PersonIncomeTax"].Value = PersonIncomeTaxSQL;
				SqlDouble WorkdaySQL = Workday;
				_dbadapter.UpdateCommand.Parameters["@Workday"].Value = WorkdaySQL;
				SqlDouble SundaySQL = Sunday;
				_dbadapter.UpdateCommand.Parameters["@Sunday"].Value = SundaySQL;
				SqlDouble HolidaySQL = Holiday;
				_dbadapter.UpdateCommand.Parameters["@Holiday"].Value = HolidaySQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SALARY_FORMULA_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SALARY_FORMULA_Disable(Guid FormulaID, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SALARY_FORMULA_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.UpdateCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SALARY_FORMULA_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SALARY_FORMULA_Delete(Guid FormulaID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("DIC_SALARY_FORMULA_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.DeleteCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.DeleteCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SALARY_FORMULA_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SALARY_FORMULA_Save(Guid FormulaID, Double SocialInsurance1, Double HealthInsurance1, Double UnemploymentInsurance1, Double SocialInsurance2, Double HealthInsurance2, Double UnemploymentInsurance2, Decimal MaximumInsurance, Double CoefficientUnion, Decimal MaximumUnion, Decimal IncomeTax, Decimal PersonIncomeTax, Double Workday, Double Sunday, Double Holiday)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SALARY_FORMULA_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance1", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance2", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@CoefficientUnion", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumUnion", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IncomeTax", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonIncomeTax", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Workday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Sunday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Holiday", SqlDbType.Float));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.UpdateCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				SqlDouble SocialInsurance1SQL = SocialInsurance1;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance1"].Value = SocialInsurance1SQL;
				SqlDouble HealthInsurance1SQL = HealthInsurance1;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance1"].Value = HealthInsurance1SQL;
				SqlDouble UnemploymentInsurance1SQL = UnemploymentInsurance1;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance1"].Value = UnemploymentInsurance1SQL;
				SqlDouble SocialInsurance2SQL = SocialInsurance2;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance2"].Value = SocialInsurance2SQL;
				SqlDouble HealthInsurance2SQL = HealthInsurance2;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance2"].Value = HealthInsurance2SQL;
				SqlDouble UnemploymentInsurance2SQL = UnemploymentInsurance2;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance2"].Value = UnemploymentInsurance2SQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.UpdateCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlDouble CoefficientUnionSQL = CoefficientUnion;
				_dbadapter.UpdateCommand.Parameters["@CoefficientUnion"].Value = CoefficientUnionSQL;
				SqlMoney MaximumUnionSQL = MaximumUnion;
				_dbadapter.UpdateCommand.Parameters["@MaximumUnion"].Value = MaximumUnionSQL;
				SqlMoney IncomeTaxSQL = IncomeTax;
				_dbadapter.UpdateCommand.Parameters["@IncomeTax"].Value = IncomeTaxSQL;
				SqlMoney PersonIncomeTaxSQL = PersonIncomeTax;
				_dbadapter.UpdateCommand.Parameters["@PersonIncomeTax"].Value = PersonIncomeTaxSQL;
				SqlDouble WorkdaySQL = Workday;
				_dbadapter.UpdateCommand.Parameters["@Workday"].Value = WorkdaySQL;
				SqlDouble SundaySQL = Sunday;
				_dbadapter.UpdateCommand.Parameters["@Sunday"].Value = SundaySQL;
				SqlDouble HolidaySQL = Holiday;
				_dbadapter.UpdateCommand.Parameters["@Holiday"].Value = HolidaySQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SALARY_FORMULA_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet DIC_SALARY_FORMULA_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("DIC_SALARY_FORMULA_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet DIC_SALARY_FORMULA_Get(Guid FormulaID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("DIC_SALARY_FORMULA_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@FormulaID", SqlDbType.UniqueIdentifier));
				_dbadapter.SelectCommand.Prepare();
				SqlGuid FormulaIDSQL = FormulaID;
				_dbadapter.SelectCommand.Parameters["@FormulaID"].Value = FormulaIDSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: DIC_SALARY_FORMULA_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
